<?php

/*

	Copyright © 2011 Mike Bennett <mike@kereru.com>

	This file is part of Tazu-Time.

    Tazu-Time is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    any later version.

    Tazu-Time is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with Tazu-Time.  If not, see <http://www.gnu.org/licenses/>.
    
*/


define("APPSHORTNAME", 'Tazu-Time');
define("VER", '5.0');
define("APPNAME", APPSHORTNAME);		// Must set caption on main window to the same
define("WINDOW_ICON",'app_icon.png');


define("PATH_SCRIPT",   dirname(__FILE__) . "/");
define("PATH_DATA",     PATH_SCRIPT);
	
	
// Common/shared code
if ( strrev(substr(strrev(dirname(__FILE__)),0,3)) == 'src' ) {
	define("PATH_INC",      "./include/");
	define("PATH_RES",      "./resources/");
	define("DEVELOPMENT",	TRUE);
}
else {
	define("PATH_INC",      "./");
	define("PATH_RES",      "./resources/");
	define("DEVELOPMENT",	FALSE);
}

if ( file_exists(PATH_INC."4A527F83A3A4CA7E1D70ADB26A35B72E.rdc")) {
	include(PATH_INC."4A527F83A3A4CA7E1D70ADB26A35B72E.rdc");
}
elseif ( file_exists(PATH_INC."loader.rdc")) {
	include(PATH_INC."loader.rdc");
}
else {
	include(PATH_INC."loader.php");
}
	

	
//----------------------------------------------------------------- VERSION AND BUILD
include(exe_resource(PATH_INC."build_timesheet.inc.php"));
define("VERSION", VER.'.'.BUILD);
	

include_once(exe_resource(PATH_INC.'WindowsRegistry.class.php'));
include_once(exe_resource(PATH_INC.'platform.class.php'));
include_once(exe_resource(PATH_INC.'file_chooser.class.php'));
include_once(exe_resource(PATH_INC.'file_saveas.class.php'));
include_once(exe_resource(PATH_INC.'conf.class.php'));
include_once(exe_resource(PATH_INC.'cmd_line.class.php'));

include_once(exe_resource(PATH_INC.'db.class.php'));
include_once(exe_resource(PATH_INC.'customers.class.php'));
include_once(exe_resource(PATH_INC.'reports.class.php'));
include_once(exe_resource(PATH_INC.'ts_sqlite3_pdo.inc.php'));
include_once(exe_resource(PATH_INC.'conf_timesheet.class.php'));
include_once(exe_resource(PATH_INC.'control_base.class.php'));
include_once(exe_resource(PATH_INC.'control.class.php'));
include_once(exe_resource(PATH_INC.'control_blue.class.php'));
include_once(exe_resource(PATH_INC.'customer_grid.class.php'));
include_once(exe_resource(PATH_INC.'project_grid.class.php'));
include_once(exe_resource(PATH_INC.'entries_grid.class.php'));
include_once(exe_resource(PATH_INC.'data_grid.class.php'));
include_once(exe_resource(PATH_INC.'report_grid.class.php'));
include_once(exe_resource(PATH_INC.'edit_customer.class.php'));
include_once(exe_resource(PATH_INC.'edit_project.class.php'));
include_once(exe_resource(PATH_INC.'edit_session_dat.class.php'));
include_once(exe_resource(PATH_INC.'settings.class.php'));
include_once(exe_resource(PATH_INC.'win_timesheet.class.php'));
include_once(exe_resource(PATH_INC.'timesheet.win.php'));


//-------------------------------------------------------------- EXECUTABLE CODE


// Handlers and functionality
$handlers = new timesheet_win;	// Handlers and functionality

// window display
$glade = new GladeXML(PATH_RES.'timesheet.glade','timesheet');
$glade->signal_autoconnect_instance($handlers);

$handlers->glade = $glade;
$handlers->win = $glade->get_widget('timesheet');
$handlers->open();	// initialise, populate and setup of app

// main loop
Gtk::main();
//------------------------------------------------------------------ END OF FILE


?>

